package com.finger.fakegps.hook;

import de.robv.android.xposed.XposedBridge;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

public class LocationBroadcastReceiver extends BroadcastReceiver {

	public static final String ACTION = "COM_FINGER_FAKEGPS_BROADCAST_RECEIVER_ACTION";
	
	@Override
	public void onReceive(Context context, Intent intent) {
		 String action = intent.getAction();
		 if(action!=null && action.equals(ACTION)){
			 XposedBridge.log("接收到修改模拟定位的广播消息.....");
			 Bundle bundle = intent.getExtras();
			 PreferencesUtils.commitInt("is_open",bundle.getInt("is_open", 0));
			 PreferencesUtils.commitString("lat",bundle.getString("lat", "0.0"));
			 PreferencesUtils.commitString("lon",bundle.getString("lon","0.0"));
			 PreferencesUtils.commitString("mnc",bundle.getString("mnc", "0"));
			 PreferencesUtils.commitString("lac",bundle.getString("lac","0"));
			 PreferencesUtils.commitString("cid",bundle.getString("cid","0"));
		 }
	}

}
